<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf常规操作</title>
</head>
<body>
<h1>首页</h1>
<div>
    <p>姓名：<span th:text="${loginName}">hyl</span></p>

    <p>姓名：<span th:text="'name:'+${loginName}">hyl</span></p>

    <p><span th:text="|姓名 ${loginName}|">hyl</span></p>
</div>
<div th:inline="text">
    <p>姓名：<span>[[${loginName}]]</span></p>
</div>
<div>
    <h1>if的使用</h1>
   <!-- <c:if test="${age <18}">
        <span>未成年</span>
    </c:if>-->

    <span th:if="${age<18}">未成年</span>
    <span th:unless="${age<18}">成年</span>
</div>

<div>
    <h1>switch的使用</h1>
<!--    switch(tmp){-->
<!--        case 1:-->
<!--            //输出-->
<!--            break;-->
<!--        default:-->
<!--            break;-->
<!--    }-->
    <p th:switch="${age}">
        <span th:case="18">成年</span>
        <span th:case="*">未知</span>
    </p>
</div>
<div>
    <h1>遍历集合</h1>
<!--    for(User tmp : userList){-->
<!--    }-->

    <div th:each="tmp:${userList}">
        <p th:text="${tmp.usrName}">张三</p>
    </div>
</div>
</body>
</html>